// shopPages/Airadar/Airadar.js
var data_list = []

Page({

  /**
   * 页面的初始数据
   */
  data: {
    tab:['全部客户','全部时间'],
    curren:0,
    sxCurren:0,
    dayCurren:0,
    list: [
      {
        img: "https://cdnimg.51jlkj.com/mingpian/20190816/02.svg",
        name: '小红',
        time: '2019-1-1 13:10',
        num: 12,
        tabnum: 1,
        tabtime: '2019-2-3 11:10',
        shop: '睡衣'
      },
      {
        img: "https://cdnimg.51jlkj.com/mingpian/20190816/02.svg",
        name: '小红',
        time: '2019-1-1 13:10',
        num: 0,
        tabnum: 1,
        tabtime: '2019-2-3 11:10',
        shop: '睡衣'
      }
    ],
    sxKehu:['全部客户','潜在客户' ,'意向客户','客户'],
    sxday: ['累计', '昨日', '上一周', '上一月'],
    page: 1,
    more_status: false,//下拉加载
    taskBack:false
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    data_list = [];
    var day3 = new Date();
    day3.setTime(day3.getTime());
    var month = day3.getMonth() + 1;
    if (month.toString().length == 1) {
      month = '0' + month;
    }
    var day = day3.getDate();
    if (day.toString().length == 1) {
      day = '0' + day;
    }
    var start = day3.getFullYear() + "-" + month + "-01";
    var end = day3.getFullYear() + "-" + month + "-" + day;
    that.setData({
      start: start,
      end: end
    });
    // that.get_data(start, end, 0);
  },
  bindtab(e){
    var index = e.currentTarget.id;
    this.setData({
      curren: index
    })
  },
  bindtab1(e) {
    var index = e.currentTarget.id;
    this.setData({
      sxCurren: index
    })
  },
  bindtab2(e) {
    var index = e.currentTarget.id;
    this.setData({
      dayCurren: index
    })
  },
  bindDateChange: function (e) {
    this.setData({
      start: e.detail.value
    })
  },
  bindDateChange1: function (e) {
    this.setData({
      end: e.detail.value
    })
  },
  isShow(){
    var taskBack = this.data.taskBack
    this.setData({
      taskBack: true
    })
  },
  getData() {
    var taskBack = this.data.taskBack
    this.setData({
      taskBack: false
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})